package br.com.locweb.core.locacao.tests;

import java.util.Date;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;

import br.com.locweb.core.locacao.factories.LocacaoFactory;
import br.com.locweb.core.locacao.manager.ILocacaoManager;
import br.com.locweb.core.locacao.model.Acervo;
import br.com.locweb.core.locacao.model.Locacao;


public class TLocacao {
	
	private ILocacaoManager locationManager;
	@Before
	public void init() {
		locationManager = LocacaoFactory.getLocacaoManagerInstance();
	}
	
	@Test
	public void loadLocacaoManager() {
		Assert.assertNotNull(LocacaoFactory.getLocacaoManagerInstance());
	}
	
	@Test
	public void alugarAcervoTest() {
		Locacao a = locationManager.alugarAcervo(new Acervo());
		Assert.assertNotNull(a);
		Assert.assertTrue(a.getDataEntrega().after(new Date()));
	}
}
